﻿using System.Web.Hosting;
using System.Reflection;

namespace Rio.Workflow.WCF.Helpers
{
    public class ConfigurationHelper
    {
        /// <summary>
        /// Returns the current application path for the current hosting environment
        /// </summary>
        /// <returns></returns>
        public static string GetEnvironnementPath()
        {
            //web host root dir 
            if (HostingEnvironment.IsHosted)
            {
                return HostingEnvironment.ApplicationPhysicalPath;
            }
            else
            {
                //bin dir
                return System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\";
            }
        }
    }
}